#include "widget.h"
#include "ui_widget.h"

#include <QPushButton>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton *button = new QPushButton(this);
    button->setText("hello world");
    button->move(200, 200);

    connect(button, &QPushButton::clicked, this, &Widget::handle);
    connect(button, &QPushButton::clicked, this, [&](){
        this->setWindowTitle("hello");
    });
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handle()
{
    setWindowTitle("hello");
}

